<?php
require_once 'mysql.php';
class tablatures
{
	var $id;
	var $band;
	var $song;
	var $tab;
	var $lyrics;
	
	function tablatures()
	{
		
	}
	function createTab($band,$song,$tab,$lyrics)
	{
		$this->band = $band;
		$this->song = $song;
		$this->tab = $tab;
		$this->lyrics = $lyrics;
	}
	function insertTab()
	{
		insert('INSERT INTO tablatures (band,song,tab,lyrics) VALUES ("'.$this->band.'","'.$this->song.'","'.$this->tab.'","'.$this->lyrics.'")');
	}
	function fetchTab($id)
	{
		$r = mysql_fetch_object(query('SELECT * FROM tablatures WHERE id ='.$id.' LIMIT 0,1'));
		$this->band = $r->band;
		$this->song = $r->song;
		$this->tab = $r->tab;
		$this->lyrics = $r->lyrics;
	}
	function updateTab($id)
	{
		if (update('UPDATE tablatures SET WHERE id = '.$id) == 0)
		{
			return 0;
		}
		else
		{
			return 1;
		}
	}
	function deleteTab($id)
	{
		if (delete('DELETE FROM tablatures WHERE id = '.$id) == 0)
		{
			return 0;
		}
		else
		{
			return 1;
		}
	}
	
}
?>